<template>
    <div>
        <h2 class="h2"><span>军籍信息表--军转干部</span></h2>
        <div>
            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="140px" class="demo-ruleForm qita" id="qita" accept-charset="UTF-8">
                <el-row :gutter="20">
                    <el-col :span="12">
                         <el-form-item class="select2" label="转业安置方式：" prop="E002">
                            <el-select v-model="ruleForm.E002" placeholder="转业安置方式">
                                <el-option label="计划分配" value="1"></el-option>
                                <el-option label="自主择业" value="2"></el-option>
                                <el-option label="自愿自行就业" value="3"></el-option>
                                <el-option label="企业军转干部" value="3"></el-option>
                                <el-option label="符合转业条件选择复员" value="3"></el-option>
                            </el-select>               
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="安置日期：" prop="E004">
                            <el-date-picker v-model="ruleForm.E004" type="date" placeholder="安置日期"></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20" class="sanjiliandong">
                    <el-form-item label="安置地点：">
                        <linkage @hujisuozaidifn="hujisuozaidifnsss"></linkage>
                    </el-form-item>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="12">
                         <el-form-item class="select2" label="安置单位性质：" prop="E005">
                            <el-select v-model="ruleForm.E005" placeholder="安置单位性质">
                                <el-option label="行政机关" value="1"></el-option>
                                <el-option label="事业单位" value="2"></el-option>
                                <el-option label="企业" value="3"></el-option>
                                <el-option label="其他" value="4"></el-option>
                            </el-select>               
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="安置单位名称：" prop="E006">
                            <el-input v-model="ruleForm.E006" id="E006" placeholder="请输入安置单位名称"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="12">
                         <el-form-item class="select2" label="现单位性质(含离退休前)：" prop="E007">
                            <el-select v-model="ruleForm.E007" placeholder="现单位性质(含离退休前)">
                                <el-option label="国家机关" value="1"></el-option>
                                <el-option label="事业单位" value="2"></el-option>
                                <el-option label="国有企业" value="3"></el-option>
                                <el-option label="集体企业" value="4"></el-option>
                                <el-option label="外资企业私营企业" value="4"></el-option>
                                <el-option label="公益性岗位" value="4"></el-option>
                                <el-option label="自由职业" value="4"></el-option>
                                <el-option label="创业" value="4"></el-option>
                            </el-select>               
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-form-item>
                        <el-button type="primary" @click="submitForm('ruleForm')">下一步</el-button>
                        <el-button @click="resetForm('ruleForm')">重置</el-button>
                    </el-form-item>
                </el-row>
            </el-form>
        </div>
    </div>
</template>

<script>
import linkage from '@/components/element/linkage'
export default {
    data(){
        return {
            ruleForm: { //默认数据
                E001:'', //退役安置方式
                E004:'', //安置日期
                E005:'',//安置单位性质
                E006:'',//请输入安置单位名称
                E008:'',//参加政府组织的教育培训状况
            },
            rules: {  //规则
                E004:[
                    { type: 'date', required: true, message: '请选择入伍时间', trigger: 'change' }
                ],
                E001:[
                    { required: true, message: '请填写退役证件名称', trigger: 'blur' },
                ],
                E005:[
                    { required: true, message: '请填写退役证件名称', trigger: 'blur' },
                ],
                E006:[
                    { required: true, message: '请填写退役证件名称', trigger: 'blur' },
                ],
                E008:[
                    { required: true, message: '请填写退役证件名称', trigger: 'blur' },
                ],
            },
        }
    },
    methods: {
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    alert('成功，tuiyishibing!');
                    console.log(this.ruleForm)
                    this.$emit('submitfn',2)
                } else {
                    console.log('error submit!!');
                    return false;
                }
            });
        },
        resetForm(formName) {
            this.$refs[formName].resetFields();
        },
        hujisuozaidifnsss(value){
            console.log(value)
            this.hujisuozaidiData = value
        },
        hujisuozaidifnsss2(value){
            console.log(value)
        }
    },
    components:{
        linkage
    }
}
</script>

<style scoped>
.el-row {
    margin-bottom: 20px;
}
.el-row:last-child {
    margin-bottom: 0;
}
</style>